package com.excilys.training.ebanking.rest.convertisseur;

import org.excilys.training.ebanking.model.Operation;
import org.springframework.stereotype.Component;

import com.excilys.training.ebanking.rest.model.InfoOperation;

@Component
public class OperationConvertisseur {
	public InfoOperation modelToDto(Operation operation) {
		InfoOperation infoOperation = new InfoOperation();
		infoOperation.setId(operation.getId());
		infoOperation.setLibelle(operation.getLibelle());
		infoOperation.setMontant(operation.getMontant());
		infoOperation.setCompte(operation.getCompte().getId());
		return infoOperation;
	}

}
